home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / hf^k-2.dms / in.adf / MUIClass.Lha / Include / Classes / TWiMUI / Popstring.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-06  |  3.2 KB  |  111 lines

  1. //
  2. //  $VER: Popstring.h   1.2 (02 Sep 1996)
  3. //
  4. //    c 1996 Thomas Wilhelmi
  5. //
  6. //
  7. // Address : Taunusstrasse 14
  8. //           61138 Niederdorfelden
  9. //           Germany
  10. //
  11. //  E-Mail : willi@twi.rhein-main.de
  12. //
  13. //   Phone : +49 (0)6101 531060
  14. //   Fax   : +49 (0)6101 531061
  15. //
  16. //
  17. //  $HISTORY:
  18. //
  19. //  16 Jun 1996 :   1.0 : first public Release
  20. //
  21. //  02 Sep 1996 :   1.2 : Neu:
  22. //                        - ClassNum() für Exception-Handling.
  23. //                        Änderungen
  24. //                        - Parameter des Copy-Konstruktor als 'const'-Parameter definiert
  25. //
  26.  
  27. #ifndef CPP_TWIMUI_POPSTRING_H
  28. #define CPP_TWIMUI_POPSTRING_H
  29.  
  30. #ifndef CPP_TWIMUI_GROUP_H
  31. #include <classes/twimui/group.h>
  32. #endif
  33.  
  34. #ifndef UTILITY_HOOKS_H
  35. #include <utility/hooks.h>
  36. #endif
  37.  
  38. class MUIPopstringCloseHook
  39.     {
  40.     private:
  41.         struct MUI_Popstring_CloseHook { Object *str; LONG success; };
  42.         struct Hook closehook;
  43.         static void CloseHookEntry(register __a0 struct Hook *, register __a2 Object *, register __a1 struct MUI_Popstring_CloseHook *);
  44.         virtual void CloseHookFunc(struct Hook *, Object *, struct MUI_Popstring_CloseHook *);
  45.     protected:
  46.         MUIPopstringCloseHook();
  47.         MUIPopstringCloseHook(const MUIPopstringCloseHook &p);
  48.         ~MUIPopstringCloseHook();
  49.         MUIPopstringCloseHook &operator= (const MUIPopstringCloseHook &);
  50.     public:
  51.         struct Hook *close() { return(&closehook); };
  52.     };
  53.  
  54. class MUIPopstringOpenHook
  55.     {
  56.     private:
  57.         struct Hook openhook;
  58.         static BOOL OpenHookEntry(register __a0 struct Hook *, register __a2 Object *, register __a1 Object **);
  59.         virtual BOOL OpenHookFunc(struct Hook *, Object *, Object **);
  60.     protected:
  61.         MUIPopstringOpenHook();
  62.         MUIPopstringOpenHook(const MUIPopstringOpenHook &p);
  63.         ~MUIPopstringOpenHook();
  64.         MUIPopstringOpenHook &operator= (const MUIPopstringOpenHook &);
  65.     public:
  66.         struct Hook *open() { return(&openhook); };
  67.     };
  68.  
  69. class MUIPopstring
  70.     :   public MUIGroup,
  71.         public MUIPopstringCloseHook,
  72.         public MUIPopstringOpenHook
  73.     {
  74.     protected:
  75.         virtual const ULONG ClassNum() const;
  76.         MUIPopstring(STRPTR cl)
  77.             :   MUIGroup(cl),
  78.                 MUIPopstringCloseHook(),
  79.                 MUIPopstringOpenHook()
  80.             { };
  81.     public:
  82.         MUIPopstring(const struct TagItem *t)
  83.             :   MUIGroup(MUIC_Popstring),
  84.                 MUIPopstringCloseHook(),
  85.                 MUIPopstringOpenHook()
  86.             {
  87.             init(t);
  88.             };
  89.         MUIPopstring(const Tag, ...);
  90.         MUIPopstring()
  91.             :   MUIGroup(MUIC_Popstring),
  92.                 MUIPopstringCloseHook(),
  93.                 MUIPopstringOpenHook()
  94.             { };
  95.         MUIPopstring(const MUIPopstring &);
  96.         virtual ~MUIPopstring();
  97.         MUIPopstring &operator= (const MUIPopstring &);
  98.         Object *ButtonO() const { return((Object *)get(MUIA_Popstring_Button)); };
  99.         void CloseHook(const struct Hook *p) { set(MUIA_Popstring_CloseHook,(ULONG)p); };
  100.         struct Hook *CloseHook() const { return((struct Hook *)get(MUIA_Popstring_CloseHook)); };
  101.         void OpenHook(const struct Hook *p) { set(MUIA_Popstring_OpenHook,(ULONG)p); };
  102.         struct Hook *OpenHook() const { return((struct Hook *)get(MUIA_Popstring_OpenHook)); };
  103.         Object *StringO() const { return((Object *)get(MUIA_Popstring_String)); };
  104.         void Toggle(const BOOL p) { set(MUIA_Popstring_Toggle,(ULONG)p); };
  105.         BOOL Toggle() const { return((BOOL)get(MUIA_Popstring_Toggle,FALSE)); };
  106.         void Close(const LONG p) { dom(MUIM_Popstring_Close,(ULONG)p); };
  107.         void Open() { dom(MUIM_Popstring_Open,0); };
  108.     };
  109.  
  110. #endif
  111.